package common.di;

import com.google.inject.Guice;
import com.google.inject.Injector;

public class DI {

    private static DI di;
    
    private Injector injector;
    
    private DI() {
        injector = Guice.createInjector(new ReleaseModule());
    }
    
    private static DI getInstance() {
        if (di == null) {
            di = new DI();
        }
        return di;
    }
    
    public static<T> T getInstance(Class<T> clazz) {
        return getInstance().getInjector().getInstance(clazz);
    }
    
    private Injector getInjector() {
        return injector;
    }
    
}
